package container

import "sync"

type SessionManager struct {
	sidMap sync.Map //map[string]struct{}{}
}

func NewSessionManager() *SessionManager {
	return &SessionManager{}
}

func (sm *SessionManager) AddSid(sid string) {
	sm.sidMap.Store(sid, struct{}{})
}

func (sm *SessionManager) Exists(sid string) bool {
	_, ok := sm.sidMap.Load(sid)
	return ok
}

func (sm *SessionManager) RemoveSid(sid string) {
	sm.sidMap.Delete(sid)
}
